<?php
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/

get_config_keytable("office_mail");
empty($do) && $do = 'list';
if ($do == 'list') {
	include_once('template/popmailadd.php');

} elseif ($do == 'save') {
	
	$savetype = getGP('savetype','P');
	$pop3 = getGP('pop3','P');
	$username = getGP('username','P');
	$password = getGP('password','P');
	$mail = getGP('mail','P');
	$type = getGP('type','P');
	
	//主表信息
	$popmail = array(
		'pop3' => $pop3,
		'username' => $username,
		'password' => $password,
		'mail' => $mail,
		'type' => $type,
		'uid' => $_USER->id
	);
	//写入主表信息
	insert_db('popmail',$popmail);
	$id=$db->insert_id();
	$content=$pop3.get_inc_log(1).$username.get_inc_log(1).$mail.get_inc_log(1).$type;
	$title='添加邮件账号';
	get_oa_log_dbadd($id,$content,$title,18,$_USER->id);
   // echo '<script language="JavaScript">window.close();window.opener.location.reload();/script>';
   goto_page('admin.php?ac=popmail&fileurl=mail');

}
?>